
package com.lungle.warmdiary.app.view.active;

import com.lungle.warmdiary.R;
import com.lungle.warmdiary.app.model.response.ActiveList;
import com.lungle.warmdiary.app.view.active.fragment.status.ActiveAbandon;
import com.lungle.warmdiary.app.view.active.fragment.status.ActiveFragment;
import com.lungle.warmdiary.app.view.active.fragment.status.ActivePass;
import com.lungle.warmdiary.app.view.active.fragment.status.ActiveRefuse;
import com.lungle.warmdiary.app.view.active.fragment.status.ActiveStop;
import com.lungle.warmdiary.app.view.active.fragment.status.ActiveUNCheck;
import com.lungle.warmdiary.app.view.active.fragment.status.ActiveUNExecute;
import com.lungle.warmdiary.app.view.active.fragment.status.ActiveUNPass;
import com.lungle.warmdiary.app.view.active.fragment.status.ActiveUNStart;


public enum ActiveTab {
    UNLIMITED(99, ActiveList.CATALOG_ACTIVE_REWARD, R.string.frame_title_UNLIMITED, 0xFF000000, ActiveFragment.class),
    STATE_UNSTART(1, ActiveList.CATALOG_ACTIVE_REWARD, R.string.frame_title_STATE_UNSTART, 0xFF6895BD, ActiveUNStart.class),
    STATE_UNEXECUTE(2, ActiveList.CATALOG_ACTIVE_REWARD, R.string.frame_title_STATE_UNEXECUTE, 0xFF897172, ActiveUNExecute.class),
    STATE_UNCHECK(3, ActiveList.CATALOG_ACTIVE_REWARD, R.string.frame_title_STATE_UNCHECK, 0xFFFBBA5A, ActiveUNCheck.class),
    STATE_PASS(4, ActiveList.CATALOG_ACTIVE_REWARD, R.string.frame_title_STATE_PASS, 0xFF31B909, ActivePass.class),
    STATE_UNPASS(5, ActiveList.CATALOG_ACTIVE_REWARD, R.string.frame_title_STATE_UNPASS, 0XFFFA4848, ActiveUNPass.class),
    STATE_REFUSE(6, ActiveList.CATALOG_ACTIVE_REWARD, R.string.frame_title_STATE_REFUSE, 0XFFFA4851, ActiveRefuse.class),
    STATE_ABANDON(7, ActiveList.CATALOG_ACTIVE_REWARD, R.string.frame_title_STATE_ABANDON, 0XFFC86B46, ActiveAbandon.class),
    STATE_STOP(8, ActiveList.CATALOG_ACTIVE_REWARD, R.string.frame_title_STATE_STOP, 0XFFD1B4AD, ActiveStop.class);


    private Class<?> clz;
    private int idx;
    private int title;
    private int catalog;
    private int color;

    private ActiveTab(int idx, int catalog, int title, int color, Class<?> clz) {
        this.idx = idx;
        this.clz = clz;
        this.setCatalog(catalog);
        this.color = color;
        this.setTitle(title);
    }

    public static ActiveTab getTabByIdx(int idx) {
        for (ActiveTab t : values()) {
            if (t.getIdx() == idx)
                return t;
        }
        return UNLIMITED;
    }

    public int getColor() {
        return color;
    }

    public Class<?> getClz() {
        return clz;
    }

    public void setClz(Class<?> clz) {
        this.clz = clz;
    }

    public int getIdx() {
        return idx;
    }

    public void setIdx(int idx) {
        this.idx = idx;
    }

    public int getTitle() {
        return title;
    }

    public void setTitle(int title) {
        this.title = title;
    }

    public int getCatalog() {
        return catalog;
    }

    public void setCatalog(int catalog) {
        this.catalog = catalog;
    }
}
